package com.test.ch02;

public class Computer {
    public void openPower(){
        System.out.println("打开笔记本...");
    }
    public void use(IUsb usb){
        usb.openDevic();
        if(usb instanceof KeyBoard){
            KeyBoard k=(KeyBoard)usb;
            k.input();
        }
        if(usb instanceof Mouse){
            Mouse m=(Mouse)usb;
            System.out.println("这是鼠标...");
        }
        usb.closeDevic();
    }
    public void closePower(){
        System.out.println("关闭笔记本...");
    }
}
